package view;

import javax.swing.BorderFactory;
import javax.swing.DefaultComboBoxModel;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.border.TitledBorder;
import javax.swing.table.DefaultTableModel;

public class InvoiceAddPanel extends JPanel {
	private JLabel lblCustomer_AddIn;
	private JLabel lblDate_AddIn;
	private JLabel lblInvoiceID_AddIn;
	private JLabel lblTotal_AddIn;
	private JLabel lblProductID_AddIn;
	private JLabel lblQuantity_AddIn;
	private JTextField tfCustomerID_AddIn;
	private JTextField tfProductID_AddIn;
	private JTextField tfTotal_AddIn;
	private JTextField tfInvoiceID_AddIn;
	private JButton btnAddNew_AddIn;
	private JButton btnAddDetail_AddIn;
	private JButton btnCheck_AddIn;
	private JButton btnAdd_AddIn;
	private JButton btnCancel_AddIn;
	private JComboBox <String> cbbDay_AddIn;
	private JComboBox <String> cbbMonth_AddIn;
	private JComboBox <String> cbbYear_AddIn;
	private JComboBox <String> cbbProductID_AddIn;
	private JPanel panelInfor_AddIn;
	private JPanel panelDetailInvoice_AddIn;
	private JScrollPane jScrollPane1;
	private JTable table_AddIn;

	private static final long serialVersionUID = 1L;

	public InvoiceAddPanel() {
		initComponents();
	}

	@SuppressWarnings({ "unchecked", "rawtypes" })
	private void initComponents() {

		panelInfor_AddIn = new JPanel();
		lblCustomer_AddIn = new JLabel();
		lblDate_AddIn = new JLabel();
		lblInvoiceID_AddIn = new JLabel();
		tfCustomerID_AddIn = new JTextField();
		cbbDay_AddIn = new JComboBox();
		cbbMonth_AddIn = new JComboBox();
		cbbYear_AddIn = new JComboBox();
		tfInvoiceID_AddIn = new JTextField();
		btnCheck_AddIn = new JButton();
		panelDetailInvoice_AddIn = new JPanel();
		lblTotal_AddIn = new JLabel();
		lblProductID_AddIn = new JLabel();
		lblQuantity_AddIn = new JLabel();
		cbbProductID_AddIn = new JComboBox();
		tfProductID_AddIn = new JTextField();
		tfTotal_AddIn = new JTextField();
		btnAddNew_AddIn = new JButton();
		btnAddDetail_AddIn = new JButton();
		jScrollPane1 = new JScrollPane();
		table_AddIn = new JTable();
		btnAdd_AddIn = new JButton();
		btnCancel_AddIn = new JButton();

		setBackground(new java.awt.Color(255, 255, 255));
		setLayout(null);

		panelInfor_AddIn.setBackground(new java.awt.Color(255, 255, 255));
		panelInfor_AddIn.setBorder(BorderFactory.createTitledBorder(null, "Information",
				TitledBorder.DEFAULT_JUSTIFICATION,
				TitledBorder.DEFAULT_POSITION, new java.awt.Font(
						"Calibri", 1, 12))); 
		panelInfor_AddIn.setLayout(null);

		lblCustomer_AddIn.setFont(new java.awt.Font("Calibri", 0, 16)); 
		lblCustomer_AddIn.setText("Customer ID:");
		panelInfor_AddIn.add(lblCustomer_AddIn);
		lblCustomer_AddIn.setBounds(40, 60, 100, 20);

		lblDate_AddIn.setFont(new java.awt.Font("Calibri", 0, 16)); 
		lblDate_AddIn.setText("Date:");
		panelInfor_AddIn.add(lblDate_AddIn);
		lblDate_AddIn.setBounds(410, 30, 50, 20);

		lblInvoiceID_AddIn.setFont(new java.awt.Font("Calibri", 0, 16)); 
		lblInvoiceID_AddIn.setText("Invoice ID:");
		panelInfor_AddIn.add(lblInvoiceID_AddIn);
		lblInvoiceID_AddIn.setBounds(40, 30, 80, 20);
		panelInfor_AddIn.add(tfCustomerID_AddIn);
		tfCustomerID_AddIn.setBounds(150, 60, 120, 20);

		cbbDay_AddIn.setModel(new DefaultComboBoxModel(new String[] { "Item 1",
				"Item 2", "Item 3", "Item 4" }));
		panelInfor_AddIn.add(cbbDay_AddIn);
		cbbDay_AddIn.setBounds(460, 30, 56, 20);

		cbbMonth_AddIn.setModel(new DefaultComboBoxModel(new String[] { "Item 1",
				"Item 2", "Item 3", "Item 4" }));
		panelInfor_AddIn.add(cbbMonth_AddIn);
		cbbMonth_AddIn.setBounds(530, 30, 56, 20);

		cbbYear_AddIn.setModel(new DefaultComboBoxModel(new String[] { "Item 1",
				"Item 2", "Item 3", "Item 4" }));
		panelInfor_AddIn.add(cbbYear_AddIn);
		cbbYear_AddIn.setBounds(600, 30, 56, 20);
		panelInfor_AddIn.add(tfInvoiceID_AddIn);
		tfInvoiceID_AddIn.setBounds(150, 30, 190, 20);

		btnCheck_AddIn.setText("Check");
		btnCheck_AddIn.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jButton3ActionPerformed(evt);
			}
		});
		panelInfor_AddIn.add(btnCheck_AddIn);
		btnCheck_AddIn.setBounds(270, 60, 70, 23);

		add(panelInfor_AddIn);
		panelInfor_AddIn.setBounds(0, 0, 750, 100);

		panelDetailInvoice_AddIn.setBackground(new java.awt.Color(255, 255, 255));
		panelDetailInvoice_AddIn.setBorder(BorderFactory.createTitledBorder(null,
				"Details Invoice", TitledBorder.DEFAULT_JUSTIFICATION,
				TitledBorder.DEFAULT_POSITION, new java.awt.Font(
						"Calibri", 1, 12))); 
		panelDetailInvoice_AddIn.setLayout(null);

		lblTotal_AddIn.setFont(new java.awt.Font("Calibri", 0, 16)); 
		lblTotal_AddIn.setText("Total:");
		panelDetailInvoice_AddIn.add(lblTotal_AddIn);
		lblTotal_AddIn.setBounds(40, 90, 80, 20);

		lblProductID_AddIn.setFont(new java.awt.Font("Calibri", 0, 16)); 
		lblProductID_AddIn.setText("Product ID:");
		panelDetailInvoice_AddIn.add(lblProductID_AddIn);
		lblProductID_AddIn.setBounds(40, 30, 80, 20);

		lblQuantity_AddIn.setFont(new java.awt.Font("Calibri", 0, 16)); 
		lblQuantity_AddIn.setText("Quantity:");
		panelDetailInvoice_AddIn.add(lblQuantity_AddIn);
		lblQuantity_AddIn.setBounds(40, 60, 80, 20);

		cbbProductID_AddIn.setModel(new DefaultComboBoxModel(new String[] { "Item 1",
				"Item 2", "Item 3", "Item 4" }));
		panelDetailInvoice_AddIn.add(cbbProductID_AddIn);
		cbbProductID_AddIn.setBounds(150, 30, 170, 20);
		panelDetailInvoice_AddIn.add(tfProductID_AddIn);
		tfProductID_AddIn.setBounds(150, 60, 170, 20);
		panelDetailInvoice_AddIn.add(tfTotal_AddIn);
		tfTotal_AddIn.setBounds(150, 90, 170, 20);

		btnAddNew_AddIn.setIcon(new ImageIcon("icon/add.png")); 
		btnAddNew_AddIn.setText("Add New");
		panelDetailInvoice_AddIn.add(btnAddNew_AddIn);
		btnAddNew_AddIn.setBounds(520, 60, 100, 30);

		btnAddDetail_AddIn.setIcon(new ImageIcon("icon/add.png")); 
		btnAddDetail_AddIn.setText("Add");
		panelDetailInvoice_AddIn.add(btnAddDetail_AddIn);
		btnAddDetail_AddIn.setBounds(420, 60, 90, 30);

		table_AddIn.setModel(new DefaultTableModel(new Object[][] {
				{ null, null, null, null, null },
				{ null, null, null, null, null },
				{ null, null, null, null, null },
				{ null, null, null, null, null },
				{ null, null, null, null, null } }, new String[] {
				"Product ID:", "Product Name:", "Quantity", "Price", "Total" }));
		jScrollPane1.setViewportView(table_AddIn);

		panelDetailInvoice_AddIn.add(jScrollPane1);
		jScrollPane1.setBounds(10, 120, 740, 110);

		add(panelDetailInvoice_AddIn);
		panelDetailInvoice_AddIn.setBounds(0, 100, 750, 240);

		btnAdd_AddIn.setIcon(new ImageIcon("icon/add.png")); 
		btnAdd_AddIn.setText("Add");
		btnAdd_AddIn.setToolTipText("");
		add(btnAdd_AddIn);
		btnAdd_AddIn.setBounds(280, 350, 90, 30);

		btnCancel_AddIn.setIcon(new ImageIcon("icon/cancle.png")); 
		btnCancel_AddIn.setText("Cancel");
		add(btnCancel_AddIn);
		btnCancel_AddIn.setBounds(390, 350, 90, 30);
	}

	private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {

	}
}
